﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using SilverZebra.Data;
using SilverZebra.Views;

namespace SilverZebra
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            
            //clickevent för menyknapparna
            btn_Home.Click += new RoutedEventHandler(NavigateToLink);
            btn_Courses.Click += new RoutedEventHandler(NavigateToLink);
            btn_Groups.Click += new RoutedEventHandler(NavigateToLink);
            btn_Presence.Click += new RoutedEventHandler(NavigateToLink);
            btn_Students.Click += new RoutedEventHandler(NavigateToLink);
        }

        void NavigateToLink(object sender, RoutedEventArgs e)
        {
            //eventhandler som sköter navigeringen till vår frame
            HyperlinkButton buttonToNavigate = sender as HyperlinkButton;
            string urlToNavigate = buttonToNavigate.Tag.ToString();
            this.ContentFrame.Navigate(new Uri(urlToNavigate, UriKind.Relative));
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {

        //    GroupsDataForm.ItemsSource = Repository.GetGroups();
        }
    }
}
